package com. zyq.service.impl;

import java.util.List;

import com.zyq.mapper.HealthInformationMapper;
import com.zyq.model.entity.HealthInformation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com. zyq.service.IHealthInformationService;

/**
 * 健康信息表Service业务层处理
 *
 * @author zyq
 * @date 2021-12-08
 */
@Service
public class HealthInformationServiceImpl implements IHealthInformationService
{
    @Autowired
    private HealthInformationMapper healthInformationMapper;

    /**
     * 查询健康信息表
     *
     * @param id 健康信息表ID
     * @return 健康信息表
     */
    @Override
    public HealthInformation selectHealthInformationById(Long id)
    {
        return healthInformationMapper.selectHealthInformationById(id);
    }

    /**
     * 查询健康信息表列表
     *
     * @param healthInformation 健康信息表
     * @return 健康信息表
     */
    @Override
    public List<HealthInformation> selectHealthInformationList(HealthInformation healthInformation)
    {
        return healthInformationMapper.selectHealthInformationList(healthInformation);
    }

    /**
     * 新增健康信息表
     *
     * @param healthInformation 健康信息表
     * @return 结果
     */
    @Override
    public int insertHealthInformation(HealthInformation healthInformation)
    {
        return healthInformationMapper.insertHealthInformation(healthInformation);
    }

    /**
     * 修改健康信息表
     *
     * @param healthInformation 健康信息表
     * @return 结果
     */
    @Override
    public int updateHealthInformation(HealthInformation healthInformation)
    {
        return healthInformationMapper.updateHealthInformation(healthInformation);
    }

    /**
     * 批量删除健康信息表
     *
     * @param ids 需要删除的健康信息表ID
     * @return 结果
     */
    @Override
    public int deleteHealthInformationByIds(Long[] ids)
    {
        return healthInformationMapper.deleteHealthInformationByIds(ids);
    }

    /**
     * 删除健康信息表信息
     *
     * @param id 健康信息表ID
     * @return 结果
     */
    @Override
    public int deleteHealthInformationById(Long id)
    {
        return healthInformationMapper.deleteHealthInformationById(id);
    }

    /**
     * 查询用户自己的健康信息
     * @param userId
     * @return
     */
    @Override
    public HealthInformation selectHealthInformationByMyself(Long userId){
        return healthInformationMapper.selectHealthInformationByMyself(userId);
    }
}
